﻿#region imports

using System.Collections.Generic;
using Codeplex.ODataTFS.Model.Entities;
using Codeplex.ODataTFS.Model.Serialization;

#endregion

namespace Codeplex.ODataTFS.Model.Repositories
{
	public class BranchRepository
	{
		private readonly TFSBranchProxy _proxy;

		public BranchRepository(TFSBranchProxy proxy)
		{
			_proxy = proxy;
		}

		public Branch GetOne(string path)
		{
			return _proxy.GetBranch(EntityTranslator.DecodePath(path));
		}

		public IEnumerable<Branch> GetBranchesByProject(string name)
		{
			return _proxy.GetBranchesByProject(name);
		}

		public IEnumerable<Branch> GetAll()
		{
			return _proxy.GetBranchesByProjectCollection();
		}
	}
}
